package com.gyms.manager;

import com.classic.okhttp.beans.HVProjectBean;

import java.util.List;

/**
 * ltx on 2016/11/17 11:09
 * 所有运动项目的单例
 */
public class AllProjectManger {
    private static AllProjectManger instance = null;
    private List<HVProjectBean> mHVProjectBeanList;//所有运动的项目
    private AllProjectManger() {

    }

    public static AllProjectManger getInstance() {
        if (instance == null) {
            instance = new AllProjectManger();
        }
        return instance;
    }

    /**
     * 根据项目Id返回name
     *
     */
    public String getNameById(String projectId){
        String mProjectName="";
        for (HVProjectBean mHVProjectBean:
                mHVProjectBeanList ) {
            if(projectId.equals(mHVProjectBean.getProjectId())){
                mProjectName=mHVProjectBean.getProjectName();
            }

        }
        return mProjectName;
    }


    public void setHVProjectBeanList(List<HVProjectBean> HVProjectBeanList) {
        mHVProjectBeanList = HVProjectBeanList;
    }

    public List<HVProjectBean> getHVProjectBeanList() {
        return mHVProjectBeanList;
    }
}
